import axios from '@/utils/http';
import base from './base';

export default {
  // 获取分类
  index(params) {
    return axios.get(
      `${base.sq}/products/${params.spaceId}/categories`,
      {
        params: {
          type: params.type,
        },
      },
    );
  },
  // 更新分类
  update(params) {
    return axios.post(
      `${base.sq}/products/${params.spaceId}/categories`,
      {
        category_items: params.categories,
        deleted_ids: params.deletedIds,
        type: params.type,
      },
    );
  },
};
